package ioStream.file.processStream.characterStream;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created with IntelliJ IDEA
 * Description:字符打印流学习
 * User:22954
 * Date:2024-03-26
 * Time:20:39
 */
public class PrintWriter_ {
    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(System.out);
        pw.println("haihai");
        pw.close();//调用close() == flush + 关闭流 ---- 才能将数据写入到文件/设备
        pw = new PrintWriter(new FileWriter("f:/Test/NewFile3.txt"));
        pw.println("yeye");
        pw.close();
    }
}
